function str2img(str) {
    var src = "templates/images/yinbiao/";
    var lenStr = str.length;
    var rsString    = "";
    for (var i=0;i<lenStr;i++) {
        var theChar   = str.substr(i,1);
        if (theChar == " ") {
            rsString += " ";
        } else if (theChar == "-") {
            rsString += "<img src=\""+src+"zhonggangxian.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar == "_") {
            rsString += "<img src=\""+src+"/xiahuaxian.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar == ".") {
            rsString += "<img src=\""+src+"dian.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar == "\\") {
            rsString += "<img src=\""+src+"xiexian.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar == "/") {
            rsString += "<img src=\""+src+"fanxiexian.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar == "?") {
            rsString += "<img src=\""+src+"wenhao.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar == ":") {
            rsString += "<img src=\""+src+"maohao.png\" border=\"0\" align=\"absmiddle\" />";
        } else if (theChar.search(/[A-Z]/)!=-1) {
        	//alert(theChar);
            rsString += "<img src=\""+src+theChar+"1.png\" border=\"0\" align=\"absmiddle\" />";
        } else{
            rsString += "<img src=\""+src+theChar+".png\" border=\"0\" align=\"absmiddle\" />";
        }
    }
    return '<img src="templates/images/fangkh-z.gif" alt="" align=\"absmiddle\" />'+ rsString + '<img src="templates/images/fangkh-y.gif" alt="" align=\"absmiddle\" />';
}

function getcookie(name) {
    var cookie_start = document.cookie.indexOf(name);
    var cookie_end = document.cookie.indexOf(";", cookie_start);
    return cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)));
}

function setcookie(cookieName, cookieValue, seconds, path, domain, secure) {
    var expires = new Date();
    expires.setTime(expires.getTime() + seconds);
    document.cookie = escape(cookieName) + '=' + escape(cookieValue)
    + (expires ? '; expires=' + expires.toGMTString() : '')
    + (path ? '; path=' + path : '/')
    + (domain ? '; domain=' + domain : '')
    + (secure ? '; secure' : '');
}

function audio(c){
    var a;
	if(c!=""){
		a='<a href="javascript:return false;" onClick="ssplay(\''+c+'\');return false;" onMouseOver="ssplay(\''+c+'\')" onMouseOut="ssstop()"><img src="templates/images/audio.gif" border="0"></a>';
	}
	return a;
}
function getFlashMovieObject(movieName){
	if (window.document[movieName]){
		return window.document[movieName];
	}
	if(navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName];
	}
	else{
		return document.getElementById(movieName);
	}
}
function ssplay(c){
	var recite = getFlashMovieObject("recite");
	if(recite){
		recite.SetVariable("audio",c);
		recite.GotoFrame(1);
	}
}
function ssstop(){
	var recite = getFlashMovieObject("recite");
	if(recite){
		recite.GotoFrame(3);
	}
}
